package secondary_classes;

import java.math.BigDecimal;
import java.math.BigInteger;

public class OpeningOrder {
	
	
	private BigInteger buyVolume;
	private BigDecimal price;
	private BigInteger sellVolume;
	private BigInteger maxExecutableVolume;
	private BigInteger minSurplus;
	
	
	public OpeningOrder(BigInteger total, BigDecimal price2) {
		super();
		this.buyVolume = total;
		this.price = price2;
		this.sellVolume = BigInteger.ZERO;
		this.maxExecutableVolume = BigInteger.ZERO;
		this.minSurplus = BigInteger.ZERO;
	}

	
	
	
	
	public BigInteger getBuyVolume() {
		return buyVolume;
	}
	public void setBuyVolume(BigInteger buyVolume) {
		this.buyVolume = buyVolume;
	}
	public BigDecimal getPrice() {
		return price;
	}
	public void setPrice(BigDecimal price) {
		this.price = price;
	}
	public BigInteger getSellVolume() {
		return sellVolume;
	}
	public void setSellVolume(BigInteger total) {
		this.sellVolume = total;
	}
	public BigInteger getMaxExecutableVolume() {
		return maxExecutableVolume;
	}
	public void setMaxExecutableVolume() {
		if(buyVolume.compareTo(sellVolume) > 0) {
			this.maxExecutableVolume = sellVolume;
		} else {
			this.maxExecutableVolume = buyVolume;
		}
	}
	public BigInteger getMinSurplus() {
		return minSurplus;
	}
	public void setMinSurplus() {
		this.minSurplus = buyVolume.subtract(sellVolume);
	}

}
